using Unity.Collections;
using UnityEditor;
using UnityEditor.SceneManagement;

public static class XEditorProject
{
    [MenuItem("Project/Jobs/Leak Detection")]
    private static void LeakDetection()
    {
        NativeLeakDetection.Mode = NativeLeakDetectionMode.Enabled;
    }

    [MenuItem("Project/Jobs/Leak Detection With Stack Trace")]
    private static void LeakDetectionWithStackTrace()
    {
        NativeLeakDetection.Mode = NativeLeakDetectionMode.EnabledWithStackTrace;
    }

    [MenuItem("Project/Jobs/No Leak Detection")]
    private static void NoLeakDetection()
    {
        NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
    }

    [MenuItem("Project/Play _F5", false, -9999)]
    public static void RunGame()
    {
        if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo())
            EditorSceneManager.OpenScene("Assets/Scenes/App.unity");

        if (!EditorApplication.isPlaying)
            EditorApplication.isPlaying = true;
    }
}
